package com.tea.app.moudles.controller;

import com.tea.common.entity.Carousel;
import com.tea.common.result.CommonResult;
import com.tea.common.service.CarouselService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 轮播图前端展示Controller
 */
@RestController
@RequestMapping("/api/carousel")
public class CarouselController {

    @Autowired
    private CarouselService carouselService;

    /**
     * 获取所有启用的轮播图列表
     */
    @GetMapping("/list")
    public CommonResult<List<Carousel>> listEnabledCarousels() {
        List<Carousel> carousels = carouselService.listEnabledCarousels();
        return CommonResult.success(carousels);
    }
} 